<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<!DOCTYPE html>
<html>
	<head>
		<title>编辑优惠券</title>
		<meta name="decorator" content="default"/>
		<script type="text/javascript">
			$(function() {
				//初始化表单验证
				$("#inputForm").initValidform();
			});
			
		</script>
	</head>
	
	<body class="mainbody">
		<form:form id="inputForm" modelAttribute="coupon" action="${ctx}/qd/coupon/save" method="post" class="form-horizontal">
			<form:hidden path="id"/>
			<!--导航栏-->
			<div class="location">
				<a href="${ctx}/qd/coupon/list" class="back"><i></i><span>返回列表页</span></a>
				<a href="${ctx}/center" class="home"><i></i><span>首页</span></a> 
				<i class="arrow"></i> 
				<a href="${ctx}/qd/coupon/"><span>优惠券管理</span></a>
				<shiro:hasPermission name="qd:coupon:edit"><i class="arrow"></i><span>${not empty coupon.id ? '修改':'添加' }优惠券</span></shiro:hasPermission>
			</div>	
			<div class="line10"></div>
			<!--/导航栏-->
	
			<!--内容-->
			<div id="floatHead" class="content-tab-wrap">
				<div class="content-tab">
					<div class="content-tab-ul-wrap">
						<ul>
							<li><a class="selected" href="javascript:;">优惠券信息</a></li>
						</ul>
					</div>
				</div>
			</div>
	
			<div class="tab-content">
				<dl>
					<dt>类型</dt>
					<dd>
					<div class="rule-single-select single-select">
								<form:select id="type" path="type" datatype="*"  errormsg="请选择优惠券类型" sucmsg=" "  nullmsg="请选择优惠券类型" >
									<form:option value=""  selected="selected"  label="请选择..."></form:option>
									<form:option value="free"  label="免费体验券"></form:option>
									<form:option value="gift"  label="赠课券"></form:option>
								</form:select>
						</div>
						<span class="Validform_checktip">*请选择优惠券类型</span>
					</dd>
				</dl>
				<dl>
					<dt>优惠券名称</dt>
					<dd>
						<form:input path="name" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入优惠券名称" errormsg="请输入优惠券名称" sucmsg=" "/>
						<span class="Validform_checktip">*请输入优惠券名称</span>
					</dd>
				</dl>
				<dl>
					<dt>优惠券显示名称</dt>
					<dd>
						<form:input path="showName" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入优惠券显示名称" errormsg="请输入优惠券显示名称" sucmsg=" "/>
						<span class="Validform_checktip">*请输入优惠券显示名称</span>
					</dd>
				</dl>
				<dl>
					<dt>优惠券使用说明</dt>
					<dd>
						<form:textarea path="instruction" htmlEscape="false" maxlength="255" class="required" cssClass="input normal" datatype="*" nullmsg="请输入优惠券使用说明" errormsg="请输入优惠券使用说明" sucmsg=" "/>
						<span class="Validform_checktip">*请输入优惠券使用说明</span>
					</dd>
				</dl>
				<dl>
					<dt>有效开始日期</dt>
					<dd>
						<div class="date-input">
								<i></i>
								<fmt:formatDate value="${coupon.starton}" pattern="yyyy-MM-dd" var="starton" />
								<form:input path="starton" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" value="${starton }" htmlEscape="false" maxlength="50"  
								class="required" cssClass="input normal" datatype="*" />
							</div>
					</dd>
				</dl>
				<dl>
					<dt>有效结束日期</dt>
					<dd>
							<div class="date-input">
								<i></i>
								<fmt:formatDate value="${coupon.endon}" pattern="yyyy-MM-dd" var="endon" />
								<form:input path="endon" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" value="${endon }" htmlEscape="false" maxlength="50"  
								class="required" cssClass="input normal" datatype="*"  />
							</div>
					</dd>
				</dl>
				<dl>
					<dt>生效所需金额</dt>
					<dd>
						<form:input path="effectMoney" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入生效所需金额" errormsg="请输入生效所需金额" sucmsg=" "/>
						<span class="Validform_checktip">*请输入生效所需金额</span>
					</dd>
				</dl>
				<dl>
					<dt>面额</dt>
					<dd>
						<form:input path="denomination" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入面额" errormsg="请输入面额" sucmsg=" "/>
						<span class="Validform_checktip">*请输入面额</span>
					</dd>
				</dl>
				<dl>
					<dt>使用范围</dt>
					<dd>
						<div class="rule-multi-porp" >
							<input   type="checkbox" name="useRanges" value="0" class="input normal" <c:if test="${coupon.useRangeBoolean.get(0)}">checked="checked"</c:if> />
							<label for="useRanges">免费体验课</label>
						</div>
						<div class="rule-multi-porp">
							<input type="checkbox" name="useRanges" value="1" class="input normal"  <c:if test="${coupon.useRangeBoolean.get(1)}">checked="checked"</c:if> />
							<label for="useRanges">普通课程</label>
						</div>
						<div class="rule-multi-porp">
							<input type="checkbox" name="useRanges" value="2" class="input normal"  <c:if test="${coupon.useRangeBoolean.get(2)}">checked="checked"</c:if>/>
							<label for="useRanges">户外课程</label>
						</div>
					</dd>
				</dl>
			</div>
			<!--/内容-->
	
			<!--工具栏-->
			<div class="page-footer">
				<div class="btn-wrap">
					<input type="submit" name="btnSubmit" value="提交保存" id="btnSubmit" class="btn" /> 
					<input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);" />
				</div>
			</div>
			<!--/工具栏-->
		</form:form>
	</body>
</html>

